package cn.well.cloud.quartz.modular.model;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 定时任务
 * </p>
 *
 * @author jiawei
 * @since 2020-02-06
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("sys_timetask")
@ApiModel(value="Timetask对象", description="定时任务")
public class Timetask extends Model<Timetask> {

    private static final long serialVersionUID = 1L;

    @TableId(value = "task_id", type = IdType.ID_WORKER)
    private Long taskId;

    @ApiModelProperty(value = "任务名")
    @TableField("name")
    private String name;

    @ApiModelProperty(value = "任务组")
    @TableField("group_name")
    private String groupName;

    @ApiModelProperty(value = "开始时间")
    @TableField("start_time")
    private Date startTime;

    @ApiModelProperty(value = "结束时间")
    @TableField("end_time")
    private Date endTime;

    @ApiModelProperty(value = "表达式")
    @TableField("cron")
    private String cron;

    @ApiModelProperty(value = "任务状态")
    @TableField("job_status")
    private String jobStatus;

    @ApiModelProperty(value = "计划状态")
    @TableField("plan_status")
    private String planStatus;

    @ApiModelProperty(value = "运行状态")
    @TableField("concurrent")
    private Integer concurrent;

    @ApiModelProperty(value = "参数")
    @TableField("job_data")
    private String jobData;

    @ApiModelProperty(value = "方法")
    @TableField("method_name")
    private String methodName;

    @ApiModelProperty(value = "实例bean")
    @TableField("bean_name")
    private String beanName;

    @ApiModelProperty(value = "任务描述")
    @TableField("description")
    private String description;

    @ApiModelProperty(value = "创建者")
    @TableField(value = "create_user", fill = FieldFill.INSERT)
    private Long createUser;

    @ApiModelProperty(value = "修改者")
    @TableField(value = "update_user", fill = FieldFill.INSERT_UPDATE)
    private Long updateUser;

    @ApiModelProperty(value = "创建时间")
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private Date createTime;

    @ApiModelProperty(value = "修改时间")
    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;


    @Override
    protected Serializable pkVal() {
        return this.taskId;
    }

}
